package com.eling.elcms.travel.model;

import com.eling.elcms.community.model.Organization;
import com.eling.elcms.core.dao.annotation.CriteriaEnhancer;
import com.eling.elcms.core.dao.annotation.CriteriaEnhancers;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.privilege.service.impl.CommonPrivilegeCriteriaEnhancer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;
/**
 * 访问方式
 * @author zhangkailun
 * 
 * 模型评审：新增模型，wulina 2016-09-07
 *
 */
@Entity
@Table(name = "travel_visitway")
@Indexed
@CriteriaEnhancers(criteriaEnhancers = { @CriteriaEnhancer(impl = CommonPrivilegeCriteriaEnhancer.class, parameter = "organization:organization") })
public class VisitWay extends BaseModel{

	private static final long serialVersionUID = -7187000359765968164L;
	
	/** 主键*/
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkVisitWay;
	
	/** 创建机构*/
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkOrganization")
    @IndexedEmbedded(depth = 1)
	private Organization organization;
	
	/** 访问方式名称*/
	@Column
	@Field
	private String name;
	
	/** 描述 */
	@Column
	@Field
	private String description;
	
	@Version
	private Integer version;

	public Long getPkVisitWay() {
		return pkVisitWay;
	}

	public void setPkVisitWay(Long pkVisitWay) {
		this.pkVisitWay = pkVisitWay;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}
		

}
